package com.wgz.medicalmanagement.domain.entity;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.Table;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;

import lombok.Data;

/**
 * 患者实体类
 * 
 * @author medical
 * @since 2023-05-29
 */
@Data
@Entity
@Table(name = "patients")
@TableName("patients")
public class Patient implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 患者姓名
     */
    @Column(name = "name", nullable = false)
    @TableField("name")
    private String name;

    /**
     * 性别
     */
    @Column(name = "gender")
    @TableField("gender")
    private String gender;

    /**
     * 年龄
     */
    @Column(name = "age")
    @TableField("age")
    private Integer age;

    /**
     * 出生日期
     */
    @Column(name = "birth_date")
    @TableField("birth_date")
    private LocalDate birthDate;

    /**
     * 身份证号
     */
    @Column(name = "id_card")
    @TableField("id_card")
    private String idCard;

    /**
     * 联系电话
     */
    @Column(name = "phone")
    @TableField("phone")
    private String phone;

    /**
     * 地址
     */
    @Column(name = "address")
    @TableField("address")
    private String address;

    /**
     * 病史
     */
    @Column(name = "medical_history", columnDefinition = "text")
    @TableField("medical_history")
    private String medicalHistory;

    /**
     * 过敏史
     */
    @Column(name = "allergies", columnDefinition = "text")
    @TableField("allergies")
    private String allergies;

    /**
     * 创建时间
     */
    @Column(name = "created_time")
    @TableField("created_time")
    private LocalDateTime createdTime;

    /**
     * 更新时间
     */
    @Column(name = "updated_time")
    @TableField("updated_time")
    private LocalDateTime updatedTime;

    /**
     * 是否删除(0:否,1:是)
     */
    @Column(name = "deleted")
    @TableField("deleted")
    @TableLogic
    private Integer deleted;
}